<template>
     <div class="wrap">
        <div class="header-wrap">
            <div class="header">
              <a class="el-icon-arrow-left home" href="#/orderput"></a>
              <a class="logo" >发单</a>
            </div>
          </div>
          <header id="zmt_head" class="zmt_head">



          </header>
          <div class="create_order-content">
<div class="content-title">基本信息<span class="span1"> （必填）</span></div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="" style="font-size:12px!important;">订单类型： <el-radio-group v-model="order.orderType" size="mini">
      <el-radio-button label="程序"></el-radio-button>
      <el-radio-button label="游戏" disabled></el-radio-button>

      <!-- <el-radio-button label="广州"></el-radio-button>
      <el-radio-button label="深圳"></el-radio-button> -->
    </el-radio-group></div><div class="am-input-control"></div></div></div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="am-input-label am-input-label-5">订单标题：</div><div class="am-input-control"><input class="input" placeholder="如：程序大作业+java（+其他信息）" type="text" v-model="order.title1"></div></div></div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="am-input-label am-input-label-5">订单类别：</div><div class="am-input-control"> <el-select v-model="order.classfiy1" placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select></div></div></div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="am-input-label am-input-label-5">订单价格：</div><div class="am-input-control"><input class="input" placeholder="请输入价格" type="text" v-model="order.money1"><span class="time">元</span></div></div></div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="am-input-label am-input-label-5">订单时长：</div><div class="am-input-control"><input class="input" placeholder="请输入时长" type="text" v-model="order.time1"><span class="time">小时</span></div></div></div>
<div class="am-whitespace am-whitespace-md"></div>
<div class="content-title">订单要求</div>
<div class="am-list-item am-textarea-item am-textarea-has-count"><div class="am-textarea-control"><textarea maxlength="200" rows="3" placeholder="请输入订单要求" v-model="order.content"></textarea></div></div>
<div class="am-whitespace am-whitespace-md"></div>
<div class="content-title">联系方式</div>
<div class="am-list-item am-input-item am-list-item-middle"><div class="am-list-line"><div class="am-input-label am-input-label-5">联系电话：</div><div class="am-input-control"><input pattern="[0-9]*" placeholder="请输入联系电话" type="text" v-model="order.phone" class="phone"></div></div></div>
<div class="am-list-item am-input-item am-list-item-middle content-padding_bottom"><div class="am-list-line"><div class="am-input-label am-input-label-5">联系QQ：</div><div class="am-input-control"><input pattern="[0-9]*" placeholder="请输入联系QQ" type="text" v-model="order.qq1" class="phone"></div></div></div>
<br>
<div class="lx--fix-bottom"><div class="am-wingblank am-wingblank-lg"><a role="button" class="am-button am-button-primary" aria-disabled="false"><span @click="publish">发布订单</span></a></div></div>
          </div>
<!-- <orderfooter></orderfooter> -->



    </div>

</template>

<script >
import { orderfooter } from '../index'
import axios from 'axios'
 export default {
    data() {
      return {
        options: [{
          value: 'java',
          label: 'java'
        }, {
          value: 'python',
          label: 'python'
        }, ],
        order:{
            time1:'',
            content:'',
            money1:'',
            qq1:'',
            phone:'',
            classfiy1:'',
            orderType:'程序',
            title1:'',
        },
        input1:'',
        drawer: false,
        direction: 'btt',
      };
    },
     components: {
        orderfooter,
     },
    methods: {
        cleanorder(){
           this.order.time1=''
            this.order.content=''
            this.order.money1=''
           this.order.qq1=''
            this.order.phone=''
            this.order.classfiy1=''
            this.order.orderType='程序'
            this.order.title1=''
        },
        publish(){
            let url='http://localhost:8098/order/publish'
            axios.post(url,this.order,{
         headers: {
           'content-type': 'application/json',
           "token":localStorage.getItem("token")  //token换成从缓存获取
        }
    }).then(resp=>{
        let result=resp.data;
        if(result.code===200){
            this.cleanorder()
             this.$message({
            showClose: true,
          message: result.errorMessage,
          type: 'success'
        });
        }else{
             this.$message({
            showClose: true,
          message: "订单有问题，请联系管理",
          type: 'error'
        });
        }
    })
        }
    }
  };
</script>
<style scoped>
.am-list-line {
    position: relative;
    display: flex;
    flex: 1 1;
    align-self: stretch;
    padding-right: 15px;
    overflow: hidden;
}
.am-input-item {
    padding-bottom: 10px;
    background-color: #fff;
    position: relative;
    display: flex;
    min-height: 44px;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
    height: 44px;
    padding-left: 15px;
}
.phone{
    font-size: 14px!important;
    appearance: none;
    width: 100%;
    padding: 2px 0;
    border: 0;
    background-color: transparent;
    line-height: 1;
    box-sizing: border-box;
}
.am-input-control {
    font-size: 17px;
    flex: 1 1;
}
.am-input-label {
    font-size: 12px!important;
    width: 70px;
    color: #2d2f3b!important;
    margin-left: 0;
    margin-right: 5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    padding: 2px 0;
}
.am-list-line {
    border: none!important;
}
.am-input-item {
    position: relative;
    display: flex;
    min-height: 44px;
    background-color: #fff;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
    height: 44px;
    padding-left: 15px;
}
.content-title {
    background-color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 20px 15px 10px;
}
.am-button-primary {
    display: block;
    outline: 0 none;
    box-sizing: border-box;
    padding: 0;
    text-align: center;
    font-size: 16px;
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: nowrap;
    color: #fff;
    border-radius: initial!important;
    background-color: #1482ff!important;
    border: 1px solid #1482ff!important;
}
.am-wingblank-lg {
    margin-left: 15px;
    margin-right: 15px;
}
.lx--fix-bottom {
    position: fixed!important;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 998;
}
textarea {
    font-size: 14px!important;
    line-height: 20px!important;
    appearance: none;
    width: 100%;
    padding: 0;
    border: 0;
    background-color: transparent;
    overflow: visible;
    display: block;
    resize: none;
    word-break: break-word;
    color: #727888!important;
    caret-color: #1482ff;
}
.am-textarea-control {
    padding-right: 15px;
    flex: 1 1;
    padding-top: 10px;
    padding-bottom: 9px;
}
.am-list-item {
    padding-bottom: 14px;
    position: relative;
    display: flex;
    padding-left: 15px;
    min-height: 44px;
    background-color: #fff;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
}
.content-title {
    background-color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 20px 15px 10px;
}
.am-whitespace-md {
    height: 10px!important;
}
.time{
    position: absolute;
    font-size: 10px;
}
.el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
  .demonstration {
    display: block;
    color: #8492a6;
    font-size: 14px;
    margin-bottom: 20px;
  }
 .am-list-extra {
    color: #888;
    line-height: 1.5;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 7px;
    padding-bottom: 7px;
        font-size: 13px!important;
    margin-right: 5px!important;
    flex: 0.6 1;
    text-align: left!important;
}
.am-list-content {
    line-height: 1.5;
    text-align: left;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 7px;
    padding-bottom: 7px;
    flex: 0.43 1!important;
    font-size: 12px!important;
}
.am-list-line {
        position: relative;
    display: flex;
    flex: 1 1;
    align-self: stretch;
    padding-right: 15px;
    overflow: hidden;
    align-items: center;
    border: none!important;
}
.am-list-item {
    position: relative;
    display: flex;
    padding-left: 15px;
    min-height: 44px;
    background-color: #fff;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
}
.input {
    font-size: 14px!important;
        appearance: none;
    width: 90%;
    padding: 2px 0;
    border: 0;
    background-color: transparent;
    line-height: 1;
    box-sizing: border-box;
}
.am-input-control {
    font-size: 17px;
    flex: 1 1;
}
.am-input-label {
    font-size: 12px!important;
    width: 70px;
    margin-left: 0;
    margin-right: 5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    padding: 2px 0;
}
.am-list-line {
    align-items: center;
    position: relative;
    display: flex;
    flex: 1 1;
    align-self: stretch;
    padding-right: 15px;
    overflow: hidden;
    border: none!important;
}
.am-list-item {
    position: relative;
    display: flex;
    min-height: 44px;
    background-color: #fff;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
}
.am-input-item {
    height: 44px;
    padding-left: 15px;
}
 .span1 {
    font-size: 11px;
    color: #ff5067;
    margin-left: 10px;
}
.content-title {
    background-color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 20px 15px 10px;
}
.create_order-content {
    background-color: #f5f5f9;
    padding: 10px 15px;
}
article>p {
    padding: 0;
    margin: 0;
        display: block;
    text-align: justify;
    font-size: 18px;
    margin-bottom: 17px;
    white-space: normal;
    line-height: 30px;
}
article {
    padding: 20px 15px 0;
    font-size: 17px;
    line-height: 1.67em;
    word-break: break-all;
    word-wrap: break-word;
    position: relative;
}
.btn{
    color: crimson;
}
.follow_btn {
    float: right;
    position: relative;
    margin-top: -10px;
    width: 53px;
    line-height: 28px;
    height: 28px;
    border-radius: 1.5px;
    background: #fff2f2;
    font-size: 12px;
    display: inline-block;
    text-align: center;
}
.zmt_time {
    font-size: 12px;
    line-height: 0px;
    height: 13px;
    vertical-align: middle;
    color: #999;
}
.zmt_name {
    display: inline-block;
    font-size: 14px;
    line-height: 0px;
    color: inherit;
    margin: 2px 0 6px;
}
.zmt-info {
    padding-left: 39px;
}
.zmt_headimg:after {
    position: absolute;
    content: '';
    left: 0;
    top: 0;
    width: 198%;
    height: 198%;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    -webkit-transform: scale(.5);
    -webkit-transform-origin: 0 0;
}
.img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}
.verify-img__head {
    border-radius: 50%;
    overflow: hidden;
}
.verify-img__poster {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 2;
}
.wrap{
       max-width: 720px;
    margin: 0 auto;
    height: auto!important;
    width: 100%;
    height: 100%;
    background: #fff;
    font-family: STHeiti,'Microsoft YaHei',Helvetica,Arial,sans-serif;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
        overflow: hidden;
}

.zmt_headimg {
    width: 35px;
    height: 35px;
    float: left;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    background-color: #eee;
    position: relative;
}
.zmt_head {
        padding: 0 15px;

}
a{
    text-decoration: none;
}
.home {
    font-size: 20px;
    position: absolute;
    top: 13.5px;
    left: 15px;
    /* background: url(https://p5.ssl.qhimg.com/t015a542a760381d5a8.png) 50% no-repeat; */
    background-size: cover;
    width: 16px;
    height: 17px;
}
.header-wrap {
    height: 44px;
    position: relative;
}
.header {
    height: 40px;
    line-height: 40px;
    padding: 2px 0;
    background: #fff;
    text-align: center;
    position: fixed;
    top: 0;
    width: 100%;
    left: 0;
    right: 0;
    z-index: 10;
}
</style>
